/*package com.winit.openapi.pms;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.fastjson.JSONObject;
import com.winit.common.spi.context.CommandContext;
import com.winit.openapi.constants.ErrorCode;
import com.winit.openapi.controller.BaseController;
import com.winit.openapi.exception.ApiException;
import com.winit.openapi.model.RequestMsg;
import com.winit.openapi.model.ResponseMsg;
import com.winit.pms.spi.v2.psc.ProductService;
import com.winit.pms.spi.v2.psc.command.ProductQueryCommand;
import com.winit.pms.spi.v2.psc.command.QueryWarehouseCommand;
import com.winit.pms.spi.v2.psc.vo.Product;

*//**
 * 产品信息
 * 
 * @version <pre>
 * Author	Version		Date		Changes
 * hui.li2 	1.0  		2015年11月10日 	Created
 *
 * </pre>
 * @since 1.
 *//*
@Controller
@RequestMapping("/pms/product")
public class PMSProductController extends BaseController {

//    @Resource
    private ProductService pscProductService;

    *//**
     * 查询产品列表
     * 
     * @param requestMsg
     * @param responseMsg
     * @return
     * @throws ParseException
     *//*
    @RequestMapping(value = "/findProductList")
    public String findProductList(@ModelAttribute RequestMsg requestMsg, @ModelAttribute ResponseMsg responseMsg)
                                                                                                                 throws ParseException {
        Object obj = requestMsg.getData();
        ProductQueryCommand command = new ProductQueryCommand();
        if (obj instanceof JSONObject) {
            JSONObject json = (JSONObject) obj;
            // 产品分类名称
            if (json.containsKey("categoryCode")) {
                command.setCategoryCode(json.getString("categoryCode"));
            }
        } else {
            throw new ApiException(ErrorCode.FIELD_TYPE_ERROR, "data");
        }

        command.setCtx(CommandContext.getContext());
        command.setOrganizationId(CommandContext.getContext().getOrgId().longValue());

        List<Product> productList = pscProductService.queryProductList(command);
        responseMsg.setData(productList);
        return SUCCESS;
    }

    *//**
     * 根据产品获取验货仓信息
     * 
     * @param requestMsg
     * @param responseMsg
     * @return
     * @throws ParseException
     *//*
    @RequestMapping(value = "/getInspectWarehouses")
    public String getInspectWarehouses(@ModelAttribute RequestMsg requestMsg, @ModelAttribute ResponseMsg responseMsg)
                                                                                                                      throws ParseException {
        Object obj = requestMsg.getData();
        QueryWarehouseCommand command = new QueryWarehouseCommand();
        if (obj instanceof JSONObject) {
            JSONObject json = (JSONObject) obj;
            if (json.containsKey("productCode")) {
                command.setProductCode(json.getString("productCode"));
            }
        } else {
            throw new ApiException(ErrorCode.FIELD_TYPE_ERROR, "data");
        }

        Map<String, String> warehouseMap = pscProductService.queryInspectWarehouseByProductCode(command);
        responseMsg.setData(warehouseMap);

        return SUCCESS;
    }

    *//**
     * 根据产品编码和验货仓编码获取目的仓信息
     * 
     * @param requestMsg
     * @param responseMsg
     * @return
     * @throws ParseException
     *//*
    @RequestMapping(value = "/getDestinationWarehouses")
    public String getDestinationWarehouses(@ModelAttribute RequestMsg requestMsg,
                                           @ModelAttribute ResponseMsg responseMsg) throws ParseException {
        Object obj = requestMsg.getData();
        QueryWarehouseCommand command = new QueryWarehouseCommand();
        if (obj instanceof JSONObject) {
            JSONObject json = (JSONObject) obj;
            //
            if (json.containsKey("productCode")) {
                command.setProductCode(json.getString("productCode"));
            }
            if (json.containsKey("warehouseCode")) {
                command.setWarehouseCode(json.getString("warehouseCode"));
            }
        } else {
            throw new ApiException(ErrorCode.FIELD_TYPE_ERROR, "data");
        }

        Map<String, String> warehouseMap = pscProductService.queryDestinationWarehouseByProductCode(command);
        responseMsg.setData(warehouseMap);

        return SUCCESS;
    }
}
*/